package com.eos.control.action.activity;

import com.eos.business.service.SysActivityBusinessService;
import com.eos.common.tool.ConstantTool;
import com.eos.control.action.base.AbstractBaseAction;
import com.eos.orm.mybatis.model.ActivtyMappModel;

public class DeleteActivtyModelAction extends AbstractBaseAction {
	private static final long serialVersionUID = 8831412118878781719L;
	private Integer activtyModelId;
	
	public void setActivtyModelId(Integer activtyModelId) {
		this.activtyModelId = activtyModelId;
	}

	@Override
	public String execute()   {
		try {
			if(null == activtyModelId || activtyModelId.intValue() == 0){
				statusCode = "300";
				message = "参数错误, 删除活动型号关系失败!";
			}else{
				ActivtyMappModel amm = new  ActivtyMappModel();
				amm.setId(activtyModelId);
				amm.setDealFlag(ConstantTool.DEAL_FLAG_FAIL);
				SysActivityBusinessService sabs = new SysActivityBusinessService();
				String exeStatus = sabs.updateActivityModelPKSelective(amm);
				if("SUCCESS".equals(exeStatus)){
					statusCode = "200";
					message = "删除活动型号关系信息成功!";
				}else{
					statusCode = "300";
					message = "系统繁忙, 删除活动型号关系信息失败!";
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			statusCode = "300";
			message = "系统异常, 删除活动型号关系信息失败!";
		}
		return SUCCESS;
	}

}
